//引入request.js

const {request}=require('./request')
module.exports={
  //封装轮播接口
  getBannerApi() {
    return request('banner/list','GET',{type:'index'})
  },
  //封装商品列表接口
  getGoodsListApi() {
   return request('/shop/goods/category/all','GET')
  },
      //获取商品信息
      getGoodsApi() {
        return request('notice/list', 'POST')
    },
  // 好礼直播接口
   getIndexDateApi() {
           return request('site/adPosition/info','GET',{key:'index-live-pic'})
        },
        //首页所有数据
        getGoodsDataApi() {
          return request('shop/goods/list')
      },

      // 搜索页面接口

      getcearchApi(value){
        return request('shop/goods/list','post',{nameLike:value})
      },

              //分类所有数据
              getListDataApi(id) {
                return request('shop/goods/list','post',{categoryId:id})
            },
            // 获取token
            autoAuthRegLoginApi(code) {
              return request('/user/wxapp/authorize','POST',{code})
            },
            // 获取数据
            updateUserApi(data) {
              return request('/user/modify','POST',data)
            },
            //获取用户详情
            getUserDetailApi(token) {
              return request('/user/detail','GET',{token})
            },
            //检测token是否有效
            checkTokenApi(token) {
              return request('/user/check-token','GET',{token})
            },
            // 详情数据
            getxiangqing(id){
return request('shop/goods/detail','GEt',{id:id})
            },
            // // 购物车
            getjiaorugouwuche(){
              return request('shopping-cart/add','POST')
            },
            // 优惠卷
youhuijuan(){
  return request('/discounts/coupons','GET')
}
          }